import * as types from '../actionTypes/todos';

// 删除todo的 action creator
export const delTodo = (id) => ({
  type: types.DEL_TODO,
  payload: id,
});

// 切换 todo 的完成状态
export const toggleTodo = (id) => ({
  type: types.TOGGLE_TODO,
  payload: id,
});

// 新建任务 action
export const addTodo = (text) => ({
  type: types.ADD_TODO,
  payload: text,
});

// 切换全部任务状态
export const toggleAll = (checked) => ({
  type: types.TOGGLE_ALL,
  payload: checked,
});
